<template>
  <div class="flex flex-column height myPrescription">
    <header-top
      class="head"
      ref="header"
      :TxtHeader="TxtHeader"
      @leftClick="back"
    ></header-top>
    <van-list
  v-model="loading"
  :finished="finished"
  finished-text="没有更多了"
  @load="onLoad"
>
<div class="content_main">
      <div class="cont_top">
        <van-dropdown-menu>
          <van-dropdown-item v-model="value1" :options="option1" />
          <van-dropdown-item v-model="value2" :options="option2" />
        </van-dropdown-menu>
      </div>
      <div class="cont_list">
        <div class="list_common">
          <div class="list_left">
            <div class="left_cont">
              <div class="left_name">就诊人</div>
              <div class="left_main">
                <span>范丽丽</span>
                <i>呼吸内科</i>
              </div>
            </div>

            <div class="left_cont">
              <div class="left_name">医师</div>
              <div class="left_main">
                <span>张忠俊</span>
                <i>主治医师</i>
              </div>
            </div>
            <div class="left_cont">
              <div class="left_name">诊断结论</div>
              <div class="left_main">
                <span>上呼吸道感染</span>
                <i></i>
              </div>
            </div>
            <div class="left_cont">
              <div class="left_name">处方日期</div>
              <div class="left_main">
                <span> 2020-9-15 </span>
                <i>9:00:00</i>
              </div>
            </div>
            <div class="left_cont">
              <div class="left_name">处方状态</div>
              <div class="left_main">
                <p class="dsh">待审核</p>
                <i></i>
              </div>
            </div>
          </div>

          <div class="list_right">
            <div class="right_text">去购药</div>
          </div>
        </div>
      </div>
      <div class="cont_list">
        <div class="list_common">
          <div class="list_left">
            <div class="left_cont">
              <div class="left_name">就诊人</div>
              <div class="left_main">
                <span>范丽丽</span>
                <i>呼吸内科</i>
              </div>
            </div>

            <div class="left_cont">
              <div class="left_name">医师</div>
              <div class="left_main">
                <span>张忠俊</span>
                <i>主治医师</i>
              </div>
            </div>
            <div class="left_cont">
              <div class="left_name">诊断结论</div>
              <div class="left_main">
                <span>上呼吸道感染</span>
                <i></i>
              </div>
            </div>
            <div class="left_cont">
              <div class="left_name">处方日期</div>
              <div class="left_main">
                <span> 2020-9-15 </span>
                <i>9:00:00</i>
              </div>
            </div>
            <div class="left_cont">
              <div class="left_name">处方状态</div>
              <div class="left_main">
                <p class="shz">审核中</p>
                <i></i>
              </div>
            </div>
          </div>

          <!-- <div class="list_right">
            <div class="right_text">去购药</div>
          </div> -->
        </div>
      </div>
      <div class="cont_list">
        <div class="list_common">
          <div class="list_left">
            <div class="left_cont">
              <div class="left_name">就诊人</div>
              <div class="left_main">
                <span>范丽丽</span>
                <i>呼吸内科</i>
              </div>
            </div>

            <div class="left_cont">
              <div class="left_name">医师</div>
              <div class="left_main">
                <span>张忠俊</span>
                <i>主治医师</i>
              </div>
            </div>
            <div class="left_cont">
              <div class="left_name">诊断结论</div>
              <div class="left_main">
                <span>上呼吸道感染</span>
                <i></i>
              </div>
            </div>
            <div class="left_cont">
              <div class="left_name">处方日期</div>
              <div class="left_main">
                <span> 2020-9-15 </span>
                <i>9:00:00</i>
              </div>
            </div>
            <div class="left_cont">
              <div class="left_name">处方状态</div>
              <div class="left_main">
                <p class="green">审核通过</p>
                <i></i>
              </div>
            </div>
          </div>

          <!-- <div class="list_right">
            <div class="right_text">去购药</div>
          </div> -->
        </div>
      </div>
      <div class="cont_list">
        <div class="list_common">
          <div class="list_left">
            <div class="left_cont">
              <div class="left_name">就诊人</div>
              <div class="left_main">
                <span>范丽丽</span>
                <i>呼吸内科</i>
              </div>
            </div>

            <div class="left_cont">
              <div class="left_name">医师</div>
              <div class="left_main">
                <span>张忠俊</span>
                <i>主治医师</i>
              </div>
            </div>
            <div class="left_cont">
              <div class="left_name">诊断结论</div>
              <div class="left_main">
                <span>上呼吸道感染</span>
                <i></i>
              </div>
            </div>
            <div class="left_cont">
              <div class="left_name">处方日期</div>
              <div class="left_main">
                <span> 2020-9-15 </span>
                <i>9:00:00</i>
              </div>
            </div>
            <div class="left_cont">
              <div class="left_name">处方状态</div>
              <div class="left_main">
                <p class="red">审核不通过</p>
                <i></i>
              </div>
            </div>
          </div>

          <div class="list_right">
            <div class="right_image">
              <img src="./image/icon_sx.png" />
            </div>
          </div>
        </div>
      </div>
    </div>
</van-list>
    
  </div>
</template>
<script>
import HeaderTop from "@/components/header-top";
export default {
  name: "myPrescription",
  components: {
    HeaderTop
  },
  data() {
    return {
      list: [],
      loading: false,
      finished: false,
      value1: 0,
      value2: "a",
      option1: [
        { text: "全部状态", value: 0 },
        { text: "通过", value: 1 },
        { text: "未通过", value: 2 }
      ],
      option2: [
        { text: "就诊人", value: "a" },
        { text: "张三", value: "b" },
        { text: "李四", value: "c" }
      ],
      TxtHeader: {
        //头部设置
        color: "#333", //头部中间文字颜色
        title: "我的处方",
        leftOpt: {
          //左边按钮设置
          icon: "",
          text: "",
          color: "#333"
        }
      }
    };
  },
  methods: {
    onLoad() {
      // 异步更新数据
      // setTimeout 仅做示例，真实场景中一般为 ajax 请求
      setTimeout(() => {
        for (let i = 0; i < 10; i++) {
          this.list.push(this.list.length + 1);
        }

        // 加载状态结束
        this.loading = false;

        // 数据全部加载完成
        if (this.list.length >= 40) {
          this.finished = true;
        }
      }, 1000);
    },
    back() {
      this.$router.go(-1);
    }
  }
};
</script>
<style scoped>
.myPrescription >>> .van-dropdown-menu__bar {
  box-shadow: none;
}
</style>
<style lang="less" scoped>
.myPrescription {
  .head {
    background: #fff;
    border-bottom: 0.01rem solid #eee;
  }
  .content_main {
    height: calc(100% - 0.5rem);
    overflow-y: auto;
    .cont_top {
      background: #fff;
      margin-bottom: 0.1rem;
    }
    .cont_list {
      background: #fff;
      display: flex;
      margin-bottom: 0.1rem;
      .list_common {
        padding: 0.2rem 0.15rem;
        display: flex;
        .list_left {
          .left_cont {
            display: flex;
            font-size: 0.14rem;
            color: #666;
            margin-bottom: 0.1rem;
            margin-right: 0.5rem;
            .left_name {
              width: 0.7rem;
            }
            .left_main {
              flex: 1;
              span {
                margin-right: 0.15rem;
              }
              p {
                font-size: 0.14rem;
                color: #fbdf91;
              }
              .shz {
                color: #fa6400;
              }
              .green {
                color: #6dd400;
              }
              .red {
                color: #e02020;
              }
              .dsh {
                color: #f7b500;
              }
            }
          }
        }
        .list_right {
          .right_image {
            img {
              width: 0.89rem;
              background-size: 100%;
            }
          }
          .right_text {
            text-align: center;
            width: 0.84rem;
            height: 0.28rem;
            color: #02c0cb;
            font-size: 0.14rem;
            line-height: 0.28rem;
            border-radius: 0.28rem;
            border: 0.01rem solid #02c0cb;
          }
        }
      }
    }
  }
}
</style>
